package com.qs.education.controller;

import org.apache.log4j.Logger;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationSubjectBean;
import com.qs.education.service.ISubjectService;

/**
 * 
 * @class SubjectController
 * @author Jason
 * @description
 * @date Nov 7, 2018 3:34:05 PM
 */
@Controller
public class SubjectController {

	@Autowired
	private ISubjectService iSubjectService;
	
	private final Logger log = Logger.getLogger(this.getClass());
	/**
	 * @Description 查询所有学科
	 * @author Jason
	 * @date Nov 7, 2018
	 * @return
	 */
	@RequiresPermissions(value={"user:view"})
	@RequestMapping("/getSubjectList")
	@ResponseBody
	public ResponseListBean<EducationSubjectBean> getSubjectList(){
		
		log.info("后台管理-->查询所有学科");
		//ModelAndView mv=new ModelAndView("subject/list");
		ResponseListBean<EducationSubjectBean> educationSubjectResponse =  iSubjectService.getSubjectList();
		//mv.addObject("educationSubjectResponse", educationSubjectResponse);
		
		return educationSubjectResponse;
	}
}
